Chapter 1: Introduction

New York city Is one of the most famous cities in the United States as it is financial, cultural and entertainment centers of the world. Of course, all of these factors are an attraction for tourists around the world to travel to New York. According to Mastercard Global Destination Index report, New York City is one of the 10 Most Visited Cities in 2019. There were 13.6 million foreign tourists that traveled to New York last year. In addition, they visited New York on an average of approximately 8 nights and spent an average of 152 dollars per day.

Airbnb is a way of international visitors to find accommodations for traveling abroad. In 2018, Airbnb has approximately 150 million guest users and 2.9 million hosts around the world, covering in over 191 countries. According to Wachsmuth et al. (2018), New York is the third-largest Airbnb market in the world, with more than 40,000 housing and apartment rental listings, covering in Manhattan, Bronx, Queens, Brooklyn, and Staten Island. Furthermore, they found that New York’s Airbnb revenue increased by 14 percent or jumped to $657 million between 2016 and 2017, in line with an increase of the number of Airbnb guests and New York’s visitors. Taking into an account of all factors, it is undeniable that Airbnb has become a way to find the accommodations in New York City for many tourists around the world. Thus, Airbnb hosts data becomes a hot topic to do the research.

This report, focuses on Airbnb hosts in New York City 2019, contains 6 chapters: chapter 2 includes source data and basic data visualization; chapter 3 give descriptive statistics with raw and cleaned data; chapter 4 do the Linear Regression to predict the price; chapter 5 summarizes the relationship between price with Neighborhood Groups and Room Types; chapter 6 summarizes the relationship between availabilty with Neighborhood Groups and Room Types; chapter 7 is the report conclusion.

Chapter 2: Description of Data

2.1 Source Data

In this study, the CSV data file comes from Inside Airbnb (http://insideairbnb.com/get-the-data.html). This dataset contains 48,865 Airbnb rental providers information in New York City 2019 with 16 variables,including housing ID, accommodation name, host names, host ID, neighborhood group, sub-neighborhoods, latitude, longitude, room type, price, minimum night for rent, the number of reviews, the date of last review, the frequency of reviews, calculated host listing counts, and the number of availabilities in one year. To review the data, str() function in R is used to view a quick snapshot of the data as follows:

## 'data.frame':    48895 obs. of  16 variables:
##  $ id                            : int  2539 2595 3647 3831 5022 5099 5121 5178 5203 5238 ...
##  $ name                          : Factor w/ 47897 levels ""," 1 Bed Apt in Utopic Williamsburg ",..: 12564 38007 45009 15582 19210 24840 8248 24887 15477 17564 ...
##  $ host_id                       : int  2787 2845 4632 4869 7192 7322 7356 8967 7490 7549 ...
##  $ host_name                     : Factor w/ 11453 levels "","​ Valéria",..: 4997 4791 2913 6210 5929 1938 3549 9649 6880 1235 ...
##  $ neighbourhood_group           : Factor w/ 5 levels "Bronx","Brooklyn",..: 2 3 3 2 3 3 2 3 3 3 ...
##  $ neighbourhood                 : Factor w/ 221 levels "Allerton","Arden Heights",..: 109 128 95 42 62 138 14 96 203 36 ...
##  $ latitude                      : num  40.6 40.8 40.8 40.7 40.8 ...
##  $ longitude                     : num  -74 -74 -73.9 -74 -73.9 ...
##  $ room_type                     : Factor w/ 3 levels "Entire home/apt",..: 2 1 2 1 1 1 2 2 2 1 ...
##  $ price                         : int  149 225 150 89 80 200 60 79 79 150 ...
##  $ minimum_nights                : int  1 1 3 1 10 3 45 2 2 1 ...
##  $ number_of_reviews             : int  9 45 0 270 9 74 49 430 118 160 ...
##  $ last_review                   : Factor w/ 1765 levels "","1/1/13","1/1/15",..: 203 1059 1 1438 348 1234 277 1244 1383 1317 ...
##  $ reviews_per_month             : num  0.21 0.38 NA 4.64 0.1 0.59 0.4 3.47 0.99 1.33 ...
##  $ calculated_host_listings_count: int  6 2 1 1 1 1 1 1 1 4 ...
##  $ availability_365              : int  365 355 365 194 0 129 0 220 0 188 ...

2.2 Geographic Coverage of Data

To do a basic data visualization, latitude and longitude in the dataset are used to draw the map, which is plotted by leaflet library in R.

(1) New York’s Airbnb with four different price groups.

To begin with first data visualization reviews, Airbnb hosts are divided by four different price groups to plot the map. Focusing on the below map, the number of Airbnb hosts that are lower than $150 per night (yellow points) are 33,957, accounting for 69.4% of all Airbnb hosts in New York City. In addition, there are 13.894 hosts or 28.4% that are in $151-$500 per night groups (blue points). Furthermore, 805 and 239 hosts are in $501-$1,000 (green points) and higher $1,000 (red points) groups, respectively.

(2) New York’s Airbnb with three different room types.

Airbnb hosts can list entire homes/apartments, private or shared rooms. According to the below map, there are 25,409 hosts for entire homes/apartments (blue points), accounting for approximately 51.9% of all Airbnb hosts in New York City. While, there are 22,326 private rooms (yellow points) and only 1,160 shared rooms (red points).

Chapter 3: Descriptive Statistics

## 'data.frame':    48895 obs. of  16 variables:
##  $ id                            : int  2539 2595 3647 3831 5022 5099 5121 5178 5203 5238 ...
##  $ name                          : Factor w/ 47897 levels ""," 1 Bed Apt in Utopic Williamsburg ",..: 12564 38007 45009 15582 19210 24840 8248 24887 15477 17564 ...
##  $ host_id                       : int  2787 2845 4632 4869 7192 7322 7356 8967 7490 7549 ...
##  $ host_name                     : Factor w/ 11453 levels "","​ Valéria",..: 4997 4791 2913 6210 5929 1938 3549 9649 6880 1235 ...
##  $ neighbourhood_group           : Factor w/ 5 levels "Bronx","Brooklyn",..: 2 3 3 2 3 3 2 3 3 3 ...
##  $ neighbourhood                 : Factor w/ 221 levels "Allerton","Arden Heights",..: 109 128 95 42 62 138 14 96 203 36 ...
##  $ latitude                      : num  40.6 40.8 40.8 40.7 40.8 ...
##  $ longitude                     : num  -74 -74 -73.9 -74 -73.9 ...
##  $ room_type                     : Factor w/ 3 levels "Entire home/apt",..: 2 1 2 1 1 1 2 2 2 1 ...
##  $ price                         : int  149 225 150 89 80 200 60 79 79 150 ...
##  $ minimum_nights                : int  1 1 3 1 10 3 45 2 2 1 ...
##  $ number_of_reviews             : int  9 45 0 270 9 74 49 430 118 160 ...
##  $ last_review                   : Factor w/ 1765 levels "","1/1/13","1/1/15",..: 203 1059 1 1438 348 1234 277 1244 1383 1317 ...
##  $ reviews_per_month             : num  0.21 0.38 NA 4.64 0.1 0.59 0.4 3.47 0.99 1.33 ...
##  $ calculated_host_listings_count: int  6 2 1 1 1 1 1 1 1 4 ...
##  $ availability_365              : int  365 355 365 194 0 129 0 220 0 188 ...
##  [1] "id"                             "name"                          
##  [3] "host_id"                        "host_name"                     
##  [5] "neighbourhood_group"            "neighbourhood"                 
##  [7] "latitude"                       "longitude"                     
##  [9] "room_type"                      "price"                         
## [11] "minimum_nights"                 "number_of_reviews"             
## [13] "last_review"                    "reviews_per_month"             
## [15] "calculated_host_listings_count" "availability_365"
##        id                                         name      
##  Min.   :    2539   Hillside Hotel                  :   18  
##  1st Qu.: 9471945   Home away from home             :   17  
##  Median :19677284                                   :   16  
##  Mean   :19017143   New york Multi-unit building    :   16  
##  3rd Qu.:29152178   Brooklyn Apartment              :   12  
##  Max.   :36487245   Loft Suite @ The Box House Hotel:   11  
##                     (Other)                         :48805  
##     host_id                 host_name        neighbourhood_group
##  Min.   :     2438   Michael     :  417   Bronx        : 1091   
##  1st Qu.:  7822033   David       :  403   Brooklyn     :20104   
##  Median : 30793816   Sonder (NYC):  327   Manhattan    :21661   
##  Mean   : 67620011   John        :  294   Queens       : 5666   
##  3rd Qu.:107434423   Alex        :  279   Staten Island:  373   
##  Max.   :274321313   Blueground  :  232                         
##                      (Other)     :46943                         
##             neighbourhood      latitude       longitude     
##  Williamsburg      : 3920   Min.   :40.50   Min.   :-74.24  
##  Bedford-Stuyvesant: 3714   1st Qu.:40.69   1st Qu.:-73.98  
##  Harlem            : 2658   Median :40.72   Median :-73.96  
##  Bushwick          : 2465   Mean   :40.73   Mean   :-73.95  
##  Upper West Side   : 1971   3rd Qu.:40.76   3rd Qu.:-73.94  
##  Hell's Kitchen    : 1958   Max.   :40.91   Max.   :-73.71  
##  (Other)           :32209                                   
##            room_type         price         minimum_nights   
##  Entire home/apt:25409   Min.   :    0.0   Min.   :   1.00  
##  Private room   :22326   1st Qu.:   69.0   1st Qu.:   1.00  
##  Shared room    : 1160   Median :  106.0   Median :   3.00  
##                          Mean   :  152.7   Mean   :   7.03  
##                          3rd Qu.:  175.0   3rd Qu.:   5.00  
##                          Max.   :10000.0   Max.   :1250.00  
##                                                             
##  number_of_reviews  last_review    reviews_per_month
##  Min.   :  0.00           :10052   Min.   : 0.010   
##  1st Qu.:  1.00    6/23/19: 1413   1st Qu.: 0.190   
##  Median :  5.00    7/1/19 : 1359   Median : 0.720   
##  Mean   : 23.27    6/30/19: 1341   Mean   : 1.373   
##  3rd Qu.: 24.00    6/24/19:  875   3rd Qu.: 2.020   
##  Max.   :629.00    7/7/19 :  718   Max.   :58.500   
##                    (Other):33137   NA's   :10052    
##  calculated_host_listings_count availability_365
##  Min.   :  1.000                Min.   :  0.0   
##  1st Qu.:  1.000                1st Qu.:  0.0   
##  Median :  1.000                Median : 45.0   
##  Mean   :  7.144                Mean   :112.8   
##  3rd Qu.:  2.000                3rd Qu.:227.0   
##  Max.   :327.000                Max.   :365.0   
## 

## Outliers identified: 2972 nPropotion (%) of outliers: 6.5 nMean of the outliers: 658.78 nMean without removing outliers: 152.72 nMean if we remove outliers: 119.97 nOutliers successfully removed n
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##       0      65     100     120     159     334    2972

## Outliers identified: 6021 nPropotion (%) of outliers: 14 nMean of the outliers: 120.22 nMean without removing outliers: 23.27 nMean if we remove outliers: 9.66 nOutliers successfully removed n
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
##    0.00    1.00    4.00    9.66   13.00   58.00    6021

## Outliers identified: 0 nPropotion (%) of outliers: 0 nMean of the outliers: NaN nMean without removing outliers: 112.78 nMean if we remove outliers: 112.78 nOutliers successfully removed n
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     0.0     0.0    45.0   112.8   227.0   365.0
##                                      price minimum_nights
## price                           1.00000000     0.01560215
## minimum_nights                  0.01560215     1.00000000
## number_of_reviews              -0.01613857    -0.06272042
## reviews_per_month              -0.01262426    -0.11114629
## calculated_host_listings_count  0.13606202     0.08171442
## availability_365                0.03281616     0.13011273
##                                number_of_reviews reviews_per_month
## price                                -0.01613857      -0.012624263
## minimum_nights                       -0.06272042      -0.111146288
## number_of_reviews                     1.00000000       0.430630638
## reviews_per_month                     0.43063064       1.000000000
## calculated_host_listings_count       -0.07159483       0.006155434
## availability_365                      0.15318854       0.168474235
##                                calculated_host_listings_count
## price                                             0.136062025
## minimum_nights                                    0.081714422
## number_of_reviews                                -0.071594825
## reviews_per_month                                 0.006155434
## calculated_host_listings_count                    1.000000000
## availability_365                                  0.211779807
##                                availability_365
## price                                0.03281616
## minimum_nights                       0.13011273
## number_of_reviews                    0.15318854
## reviews_per_month                    0.16847424
## calculated_host_listings_count       0.21177981
## availability_365                     1.00000000

Chapter 4: Linear Regression

##        id                                         name      
##  Min.   :    2539   Home away from home             :   12  
##  1st Qu.: 9045427   Loft Suite @ The Box House Hotel:   11  
##  Median :19175650   #NAME?                          :   10  
##  Mean   :18313347   Brooklyn Apartment              :    9  
##  3rd Qu.:27703016   Private Room                    :    9  
##  Max.   :36455809   Cozy Brooklyn Apartment         :    8  
##                     (Other)                         :32978  
##     host_id            host_name        neighbourhood_group
##  Min.   :     2571   Michael:  267   Bronx        :  826   
##  1st Qu.:  7248357   David  :  256   Brooklyn     :14526   
##  Median : 29464755   John   :  209   Manhattan    :13194   
##  Mean   : 64562362   Alex   :  184   Queens       : 4192   
##  3rd Qu.:101978485   Sarah  :  170   Staten Island:  299   
##  Max.   :273841667   Maria  :  155                         
##                      (Other):31796                         
##             neighbourhood      latitude       longitude     
##  Bedford-Stuyvesant: 2806   Min.   :40.51   Min.   :-74.24  
##  Williamsburg      : 2776   1st Qu.:40.69   1st Qu.:-73.98  
##  Harlem            : 1950   Median :40.72   Median :-73.95  
##  Bushwick          : 1767   Mean   :40.73   Mean   :-73.95  
##  East Village      : 1287   3rd Qu.:40.76   3rd Qu.:-73.93  
##  Hell's Kitchen    : 1191   Max.   :40.91   Max.   :-73.71  
##  (Other)           :21260                                   
##            room_type         price     minimum_nights   number_of_reviews
##  Entire home/apt:16086   Min.   :  0   Min.   : 1.000   Min.   :  1.00   
##  Private room   :16191   1st Qu.: 65   1st Qu.: 1.000   1st Qu.:  3.00   
##  Shared room    :  760   Median :100   Median : 2.000   Median : 11.00   
##                          Mean   :118   Mean   : 2.661   Mean   : 31.73   
##                          3rd Qu.:150   3rd Qu.: 3.000   3rd Qu.: 37.00   
##                          Max.   :334   Max.   :11.000   Max.   :629.00   
##                                                                          
##   last_review    reviews_per_month calculated_host_listings_count
##  6/23/19: 1311   Min.   : 0.010    Min.   :  1.000               
##  7/1/19 : 1242   1st Qu.: 0.210    1st Qu.:  1.000               
##  6/30/19: 1222   Median : 0.850    Median :  1.000               
##  6/24/19:  801   Mean   : 1.482    Mean   :  3.343               
##  7/7/19 :  674   3rd Qu.: 2.230    3rd Qu.:  2.000               
##  7/2/19 :  614   Max.   :58.500    Max.   :327.000               
##  (Other):27173                                                   
##  availability_365
##  Min.   :  0.0   
##  1st Qu.:  0.0   
##  Median : 38.0   
##  Mean   :103.7   
##  3rd Qu.:190.0   
##  Max.   :365.0   
## 

4.1 Linear Regression

Smart Question: How do minimum night, number of reviews, reviews per month, calculated host listings count and availability predict price?

## 
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
## 
##     recode
## 
## Call:
## lm(formula = price ~ minimum_nights + number_of_reviews + reviews_per_month + 
##     calculated_host_listings_count + availability_365, data = nyc4)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -124.86  -50.88  -16.84   35.82  227.07 
## 
## Coefficients:
##                                  Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                    109.646231   0.839378 130.628  < 2e-16 ***
## minimum_nights                   2.810407   0.210163  13.373  < 2e-16 ***
## number_of_reviews                0.005585   0.008675   0.644     0.52    
## reviews_per_month               -1.155127   0.256644  -4.501 6.79e-06 ***
## calculated_host_listings_count   0.304686   0.016975  17.949  < 2e-16 ***
## availability_365                 0.013871   0.003042   4.560 5.14e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 65.71 on 33031 degrees of freedom
## Multiple R-squared:  0.01742,    Adjusted R-squared:  0.01727 
## F-statistic: 117.1 on 5 and 33031 DF,  p-value: < 2.2e-16
##                 minimum_nights              number_of_reviews 
##                       1.076810                       1.463123 
##              reviews_per_month calculated_host_listings_count 
##                       1.531107                       1.022583 
##               availability_365 
##                       1.108524

All variables except number_of_reviews are statistically significant at the one percent level. The intercept suggests that 107 dollars is the mean price of an Air B&B. The coefficent on minimum_nights suggests that a one unit increase in the minimum number of nights increases the price by 3.58 dollars. The coefficient on reviews_per_month suggests that a one unit increase in reviews per month decreases price by 1.09 dollars. The coefficient on calculated_host_listings_count suggests that a one unit increase in the count of calculated host listings increases price by .31 cents. The coefficient on availability_365 suggests that a one unit increase in availability throughout the year increases price by .01 cents. The VIF test suggests that multicollinearity is not a concern in this linear model.

Chapter 5: Neighbourhood Groups, Room Types and Price

Airbnb is frequently depicted as a better option for travelers looking for lower-cost accommodations. However, as Airbnb provides only a peer-to-peer exchange platform and does not set the prices directly, the hosts make their own decisions on prices when renting out their homes. In this chapter, we look at the price differences of Airbnb homes in New York City across neighbourhood groups and room types. Prices are in dollars.

5.1 SMART Question

####Are there differences in Airbnb home prices across New York city neighbourhood groups and room types?

5.2 Is there a difference in mean Airbnb home price among NYC Neighbourhood Groups?

####H0: There is no difference in mean Airbnb home price among NYC Neighbourhood Groups. ####H1: There is a difference in mean Airbnb home price among NYC Neighbourhood Groups. There are five neighbourhood groups (boroughs) in this dataset: (1) Manhattan: the smallest yet most densely populated borough. It is considered the economic hub of the United States and even of the world. (2) Brooklyn: the most populous borough. (3) Queens: the largest borough and also the second most populous. (4) Bronx: much of the borough is open space. (5) Staten Island: the least populated borough. Because the economic condition, density of population, and usage of land (and many other factors) are different among the five neighbourhood groups, we expect to find significant differences in Airbnb home prices. We use ANOVA to test this hypothesis. Below are the summary of the results.

##                        Df    Sum Sq Mean Sq F value Pr(>F)    
## neighbourhood_group     4  24781929 6195482    1509 <2e-16 ***
## Residuals           45918 188500166    4105                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

As we can see from the ANOVA table above, F(4, 44665) = 1427, p < .001. Since the p-value is much smaller than a significance level of 0.05, we reject the null hypothesis that there is no difference in the means of Airbnb home prices among NYC Neighbourhood Groups and conclude that there is a significant difference in mean Airbnb home prices among NYC Neighbourhood Groups.

##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = price ~ neighbourhood_group, data = d1)
## 
## $neighbourhood_group
##                                diff        lwr        upr     p adj
## Brooklyn-Bronx           28.3341931  22.845989  33.822397 0.0000000
## Manhattan-Bronx          68.5874145  63.099879  74.074950 0.0000000
## Queens-Bronx             11.5390163   5.705153  17.372880 0.0000007
## Staten Island-Bronx      11.8701959   1.276184  22.464208 0.0190278
## Manhattan-Brooklyn       40.2532213  38.481432  42.025010 0.0000000
## Queens-Brooklyn         -16.7951768 -19.452272 -14.138082 0.0000000
## Staten Island-Brooklyn  -16.4639973 -25.697593  -7.230402 0.0000114
## Queens-Manhattan        -57.0483982 -59.704112 -54.392684 0.0000000
## Staten Island-Manhattan -56.7172186 -65.950417 -47.484021 0.0000000
## Staten Island-Queens      0.3311796  -9.111959   9.774318 0.9999811

To further explore the price differences among the 5 neighbourhood groups, we conduct a Tukey multiple comparisons of means test. As can be seen from the table above , there are signficant differences in mean Airbnb home prices among the 5 neighbourhood groups (p-value all smaller than 0.05), except for Staten Island and Queens (p = 0.9999811).

5.3 Is there a difference in mean Airbnb home price across room types?

H0: There is no difference in mean Airbnb price across room types.

H1: There is a difference in mean Airbnb price across room types.

There are three types of home for rent in this dataset: (1) Entire home/apartment: Whole house/apartment is private. (2) Private room: Private bedroom. Other areas are shared. (3) Shared room: All areas (including bedrooms) are shared. One selling point of Airbnb is that it provides a nontraditional way of lodging for travellers. The room types provided on Airbnb platform is a combination of traditional hotel and hostel. Since there are usually considerable differences in the rates of hotels and hostels, we expect to find significant differences in the means of Airbnb prices across room types. We use ANOVA to test this hypothesis. Below are the summary of the results.

##                Df    Sum Sq  Mean Sq F value Pr(>F)    
## d$room_type     2  82350853 41175426   14441 <2e-16 ***
## Residuals   45920 130931242     2851                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2972 observations deleted due to missingness

As we can see from the ANOVA table above, F(2, 44667) = 15207. Since the p-value is much smaller than a significance level of 0.05, we reject the null hypothesis that there is no difference in the mean Airbnb home prices across home types and conclude that there are significant differences in the mean Airbnb price across home types.

##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = d$price ~ d$room_type, data = d1)
## 
## $`d$room_type`
##                                    diff        lwr       upr p adj
## Private room-Entire home/apt  -83.50859  -84.69151 -82.32568     0
## Shared room-Entire home/apt  -103.23360 -107.03491 -99.43229     0
## Shared room-Private room      -19.72501  -23.52957 -15.92044     0

Post hoc comparisons using the Tukey test was carried out. There were significant differences among mean prices of private room, entire home/apartment and shared room.

5.4 Is there difference in mean Airbnd home price for different neighbourhood groups and room types?

H0: There is no difference in mean Airbnb home price for different neighbourhood groups and room types.

H1: There is a difference in mean Airbnb home price for different neighbourhood groups and room types.

Taking the analysis one step further, we also investigated whether neighbourhood groups and room types interact to create an synergistic effect. Therefore, a two-way ANOVA with interaction effect was carried out.

##                                      Df    Sum Sq  Mean Sq  F value Pr(>F)
## d$neighbourhood_group                 4  24781929  6195482  2428.58 <2e-16
## d$room_type                           2  70811087 35405543 13878.71 <2e-16
## d$neighbourhood_group:d$room_type     8    574606    71826    28.16 <2e-16
## Residuals                         45908 117114473     2551                
##                                      
## d$neighbourhood_group             ***
## d$room_type                       ***
## d$neighbourhood_group:d$room_type ***
## Residuals                            
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 2972 observations deleted due to missingness

As can be seen from the above table, there was a statistically significant interaction between the effects of neighbourhood group and room types on Airbnb home price [F(8, 44655) = 24.24, p < .001]. The results indicate that there is the mean Airbnb home price varies with neighbourhood group and room type. The presence of interaction between neighbourhood group and room type means that the way Airbnb home price changes for different neighbourhood groups depends on room types. Similarly, the way Airbnb home price changes for different room types depends on neighbourhood groups.

##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = d$price ~ d$neighbourhood_group * d$room_type, data = d1)
## 
## $`d$neighbourhood_group`
##                                diff        lwr        upr     p adj
## Brooklyn-Bronx           28.3341931  24.007790  32.660596 0.0000000
## Manhattan-Bronx          68.5874145  64.261539  72.913290 0.0000000
## Queens-Bronx             11.5390163   6.940127  16.137906 0.0000000
## Staten Island-Bronx      11.8701959   3.518836  20.221555 0.0010019
## Manhattan-Brooklyn       40.2532213  38.856503  41.649939 0.0000000
## Queens-Brooklyn         -16.7951768 -18.889790 -14.700564 0.0000000
## Staten Island-Brooklyn  -16.4639973 -23.742928  -9.185067 0.0000000
## Queens-Manhattan        -57.0483982 -59.141922 -54.954874 0.0000000
## Staten Island-Manhattan -56.7172186 -63.995836 -49.438602 0.0000000
## Staten Island-Queens      0.3311796  -7.112935   7.775295 0.9999512
## 
## $`d$room_type`
##                                   diff        lwr       upr p adj
## Private room-Entire home/apt -76.26547  -77.38438 -75.14656     0
## Shared room-Entire home/apt  -97.33297 -100.92859 -93.73735     0
## Shared room-Private room     -21.06750  -24.66620 -17.46880     0
## 
## $`d$neighbourhood_group:d$room_type`
##                                                                  diff
## Brooklyn:Entire home/apt-Bronx:Entire home/apt             36.0064878
## Manhattan:Entire home/apt-Bronx:Entire home/apt            69.4930034
## Queens:Entire home/apt-Bronx:Entire home/apt               19.1327954
## Staten Island:Entire home/apt-Bronx:Entire home/apt         8.8936934
## Bronx:Private room-Bronx:Entire home/apt                  -51.5999133
## Brooklyn:Private room-Bronx:Entire home/apt               -41.9121496
## Manhattan:Private room-Bronx:Entire home/apt              -14.1378925
## Queens:Private room-Bronx:Entire home/apt                 -46.4632736
## Staten Island:Private room-Bronx:Entire home/apt          -49.9030391
## Bronx:Shared room-Bronx:Entire home/apt                   -64.9413550
## Brooklyn:Shared room-Bronx:Entire home/apt                -64.1590959
## Manhattan:Shared room-Bronx:Entire home/apt               -36.2558073
## Queens:Shared room-Bronx:Entire home/apt                  -65.2059016
## Staten Island:Shared room-Bronx:Entire home/apt           -54.7511478
## Manhattan:Entire home/apt-Brooklyn:Entire home/apt         33.4865156
## Queens:Entire home/apt-Brooklyn:Entire home/apt           -16.8736923
## Staten Island:Entire home/apt-Brooklyn:Entire home/apt    -27.1127944
## Bronx:Private room-Brooklyn:Entire home/apt               -87.6064011
## Brooklyn:Private room-Brooklyn:Entire home/apt            -77.9186374
## Manhattan:Private room-Brooklyn:Entire home/apt           -50.1443803
## Queens:Private room-Brooklyn:Entire home/apt              -82.4697614
## Staten Island:Private room-Brooklyn:Entire home/apt       -85.9095269
## Bronx:Shared room-Brooklyn:Entire home/apt               -100.9478428
## Brooklyn:Shared room-Brooklyn:Entire home/apt            -100.1655837
## Manhattan:Shared room-Brooklyn:Entire home/apt            -72.2622951
## Queens:Shared room-Brooklyn:Entire home/apt              -101.2123893
## Staten Island:Shared room-Brooklyn:Entire home/apt        -90.7576356
## Queens:Entire home/apt-Manhattan:Entire home/apt          -50.3602080
## Staten Island:Entire home/apt-Manhattan:Entire home/apt   -60.5993100
## Bronx:Private room-Manhattan:Entire home/apt             -121.0929167
## Brooklyn:Private room-Manhattan:Entire home/apt          -111.4051531
## Manhattan:Private room-Manhattan:Entire home/apt          -83.6308960
## Queens:Private room-Manhattan:Entire home/apt            -115.9562770
## Staten Island:Private room-Manhattan:Entire home/apt     -119.3960425
## Bronx:Shared room-Manhattan:Entire home/apt              -134.4343584
## Brooklyn:Shared room-Manhattan:Entire home/apt           -133.6520994
## Manhattan:Shared room-Manhattan:Entire home/apt          -105.7488108
## Queens:Shared room-Manhattan:Entire home/apt             -134.6989050
## Staten Island:Shared room-Manhattan:Entire home/apt      -124.2441513
## Staten Island:Entire home/apt-Queens:Entire home/apt      -10.2391020
## Bronx:Private room-Queens:Entire home/apt                 -70.7327087
## Brooklyn:Private room-Queens:Entire home/apt              -61.0449451
## Manhattan:Private room-Queens:Entire home/apt             -33.2706880
## Queens:Private room-Queens:Entire home/apt                -65.5960690
## Staten Island:Private room-Queens:Entire home/apt         -69.0358345
## Bronx:Shared room-Queens:Entire home/apt                  -84.0741504
## Brooklyn:Shared room-Queens:Entire home/apt               -83.2918914
## Manhattan:Shared room-Queens:Entire home/apt              -55.3886028
## Queens:Shared room-Queens:Entire home/apt                 -84.3386970
## Staten Island:Shared room-Queens:Entire home/apt          -73.8839433
## Bronx:Private room-Staten Island:Entire home/apt          -60.4936067
## Brooklyn:Private room-Staten Island:Entire home/apt       -50.8058431
## Manhattan:Private room-Staten Island:Entire home/apt      -23.0315860
## Queens:Private room-Staten Island:Entire home/apt         -55.3569670
## Staten Island:Private room-Staten Island:Entire home/apt  -58.7967325
## Bronx:Shared room-Staten Island:Entire home/apt           -73.8350484
## Brooklyn:Shared room-Staten Island:Entire home/apt        -73.0527894
## Manhattan:Shared room-Staten Island:Entire home/apt       -45.1495008
## Queens:Shared room-Staten Island:Entire home/apt          -74.0995950
## Staten Island:Shared room-Staten Island:Entire home/apt   -63.6448413
## Brooklyn:Private room-Bronx:Private room                    9.6877636
## Manhattan:Private room-Bronx:Private room                  37.4620207
## Queens:Private room-Bronx:Private room                      5.1366397
## Staten Island:Private room-Bronx:Private room               1.6968742
## Bronx:Shared room-Bronx:Private room                      -13.3414417
## Brooklyn:Shared room-Bronx:Private room                   -12.5591827
## Manhattan:Shared room-Bronx:Private room                   15.3441059
## Queens:Shared room-Bronx:Private room                     -13.6059883
## Staten Island:Shared room-Bronx:Private room               -3.1512346
## Manhattan:Private room-Brooklyn:Private room               27.7742571
## Queens:Private room-Brooklyn:Private room                  -4.5511239
## Staten Island:Private room-Brooklyn:Private room           -7.9908895
## Bronx:Shared room-Brooklyn:Private room                   -23.0292054
## Brooklyn:Shared room-Brooklyn:Private room                -22.2469463
## Manhattan:Shared room-Brooklyn:Private room                 5.6563423
## Queens:Shared room-Brooklyn:Private room                  -23.2937519
## Staten Island:Shared room-Brooklyn:Private room           -12.8389982
## Queens:Private room-Manhattan:Private room                -32.3253810
## Staten Island:Private room-Manhattan:Private room         -35.7651466
## Bronx:Shared room-Manhattan:Private room                  -50.8034625
## Brooklyn:Shared room-Manhattan:Private room               -50.0212034
## Manhattan:Shared room-Manhattan:Private room              -22.1179148
## Queens:Shared room-Manhattan:Private room                 -51.0680090
## Staten Island:Shared room-Manhattan:Private room          -40.6132553
## Staten Island:Private room-Queens:Private room             -3.4397655
## Bronx:Shared room-Queens:Private room                     -18.4780814
## Brooklyn:Shared room-Queens:Private room                  -17.6958224
## Manhattan:Shared room-Queens:Private room                  10.2074662
## Queens:Shared room-Queens:Private room                    -18.7426280
## Staten Island:Shared room-Queens:Private room              -8.2878743
## Bronx:Shared room-Staten Island:Private room              -15.0383159
## Brooklyn:Shared room-Staten Island:Private room           -14.2560568
## Manhattan:Shared room-Staten Island:Private room           13.6472318
## Queens:Shared room-Staten Island:Private room             -15.3028625
## Staten Island:Shared room-Staten Island:Private room       -4.8481087
## Brooklyn:Shared room-Bronx:Shared room                      0.7822591
## Manhattan:Shared room-Bronx:Shared room                    28.6855477
## Queens:Shared room-Bronx:Shared room                       -0.2645466
## Staten Island:Shared room-Bronx:Shared room                10.1902072
## Manhattan:Shared room-Brooklyn:Shared room                 27.9032886
## Queens:Shared room-Brooklyn:Shared room                    -1.0468056
## Staten Island:Shared room-Brooklyn:Shared room              9.4079481
## Queens:Shared room-Manhattan:Shared room                  -28.9500942
## Staten Island:Shared room-Manhattan:Shared room           -18.4953405
## Staten Island:Shared room-Queens:Shared room               10.4547537
##                                                                  lwr
## Brooklyn:Entire home/apt-Bronx:Entire home/apt             26.835715
## Manhattan:Entire home/apt-Bronx:Entire home/apt            60.359559
## Queens:Entire home/apt-Bronx:Entire home/apt                9.369000
## Staten Island:Entire home/apt-Bronx:Entire home/apt        -7.089284
## Bronx:Private room-Bronx:Entire home/apt                  -62.829225
## Brooklyn:Private room-Bronx:Entire home/apt               -51.062989
## Manhattan:Private room-Bronx:Entire home/apt              -23.336217
## Queens:Private room-Bronx:Entire home/apt                 -55.927798
## Staten Island:Private room-Bronx:Entire home/apt          -65.293866
## Bronx:Shared room-Bronx:Entire home/apt                   -88.984722
## Brooklyn:Shared room-Bronx:Entire home/apt                -76.496240
## Manhattan:Shared room-Bronx:Entire home/apt               -48.252285
## Queens:Shared room-Bronx:Entire home/apt                  -80.439125
## Staten Island:Shared room-Bronx:Entire home/apt          -112.549477
## Manhattan:Entire home/apt-Brooklyn:Entire home/apt         31.061919
## Queens:Entire home/apt-Brooklyn:Entire home/apt           -21.091580
## Staten Island:Entire home/apt-Brooklyn:Entire home/apt    -40.451251
## Bronx:Private room-Brooklyn:Entire home/apt               -94.574637
## Brooklyn:Private room-Brooklyn:Entire home/apt            -80.407961
## Manhattan:Private room-Brooklyn:Entire home/apt           -52.802958
## Queens:Private room-Brooklyn:Entire home/apt              -85.939069
## Staten Island:Private room-Brooklyn:Entire home/apt       -98.532379
## Bronx:Shared room-Brooklyn:Entire home/apt               -123.320647
## Brooklyn:Shared room-Brooklyn:Entire home/apt            -108.806417
## Manhattan:Shared room-Brooklyn:Entire home/apt            -80.409341
## Queens:Shared room-Brooklyn:Entire home/apt              -113.642593
## Staten Island:Shared room-Brooklyn:Entire home/apt       -147.881236
## Queens:Entire home/apt-Manhattan:Entire home/apt          -54.496306
## Staten Island:Entire home/apt-Manhattan:Entire home/apt   -73.912130
## Bronx:Private room-Manhattan:Entire home/apt             -128.011952
## Brooklyn:Private room-Manhattan:Entire home/apt          -113.753230
## Manhattan:Private room-Manhattan:Entire home/apt          -86.157706
## Queens:Private room-Manhattan:Entire home/apt            -119.325672
## Staten Island:Private room-Manhattan:Entire home/apt     -131.991801
## Bronx:Shared room-Manhattan:Entire home/apt              -156.791887
## Brooklyn:Shared room-Manhattan:Entire home/apt           -142.253304
## Manhattan:Shared room-Manhattan:Entire home/apt          -113.853814
## Queens:Shared room-Manhattan:Entire home/apt             -147.101594
## Staten Island:Shared room-Manhattan:Entire home/apt      -181.361771
## Staten Island:Entire home/apt-Queens:Entire home/apt      -23.992032
## Bronx:Private room-Queens:Entire home/apt                 -78.464781
## Brooklyn:Private room-Queens:Entire home/apt              -65.219316
## Manhattan:Private room-Queens:Entire home/apt             -37.548149
## Queens:Private room-Queens:Entire home/apt                -70.419422
## Staten Island:Private room-Queens:Entire home/apt         -82.095890
## Bronx:Shared room-Queens:Entire home/apt                 -106.696507
## Brooklyn:Shared room-Queens:Entire home/apt               -92.559719
## Manhattan:Shared room-Queens:Entire home/apt              -64.197859
## Queens:Shared room-Queens:Entire home/apt                 -97.212647
## Staten Island:Shared room-Queens:Entire home/apt         -131.105743
## Bronx:Private room-Staten Island:Entire home/apt          -75.322929
## Brooklyn:Private room-Staten Island:Entire home/apt       -64.130603
## Manhattan:Private room-Staten Island:Entire home/apt      -36.389001
## Queens:Private room-Staten Island:Entire home/apt         -68.899071
## Staten Island:Private room-Staten Island:Entire home/apt  -76.981586
## Bronx:Shared room-Staten Island:Entire home/apt           -99.755983
## Brooklyn:Shared room-Staten Island:Entire home/apt        -88.737702
## Manhattan:Shared room-Staten Island:Entire home/apt       -60.567894
## Queens:Shared room-Staten Island:Entire home/apt          -92.151256
## Staten Island:Shared room-Staten Island:Entire home/apt  -122.249092
## Brooklyn:Private room-Bronx:Private room                    2.745782
## Manhattan:Private room-Bronx:Private room                  30.457564
## Queens:Private room-Bronx:Private room                     -2.213902
## Staten Island:Private room-Bronx:Private room             -12.492234
## Bronx:Shared room-Bronx:Private room                      -36.633860
## Brooklyn:Shared room-Bronx:Private room                   -23.360033
## Manhattan:Shared room-Bronx:Private room                    4.934076
## Queens:Shared room-Bronx:Private room                     -27.623988
## Staten Island:Shared room-Bronx:Private room              -60.641234
## Manhattan:Private room-Brooklyn:Private room               25.185274
## Queens:Private room-Brooklyn:Private room                  -7.967392
## Staten Island:Private room-Brooklyn:Private room          -20.599268
## Bronx:Shared room-Brooklyn:Private room                   -45.393846
## Brooklyn:Shared room-Brooklyn:Private room                -30.866621
## Manhattan:Shared room-Brooklyn:Private room                -2.468259
## Queens:Shared room-Brooklyn:Private room                  -35.709256
## Staten Island:Shared room-Brooklyn:Private room           -69.959402
## Queens:Private room-Manhattan:Private room                -35.866877
## Staten Island:Private room-Manhattan:Private room         -48.408030
## Bronx:Shared room-Manhattan:Private room                  -73.187574
## Brooklyn:Shared room-Manhattan:Private room               -58.691272
## Manhattan:Shared room-Manhattan:Private room              -30.295962
## Queens:Shared room-Manhattan:Private room                 -63.518553
## Staten Island:Shared room-Manhattan:Private room          -97.741285
## Staten Island:Private room-Queens:Private room            -16.277622
## Bronx:Shared room-Queens:Private room                     -40.972892
## Brooklyn:Shared room-Queens:Private room                  -26.647814
## Manhattan:Shared room-Queens:Private room                   1.731116
## Queens:Shared room-Queens:Private room                    -31.391110
## Staten Island:Shared room-Queens:Private room             -65.459369
## Bronx:Shared room-Staten Island:Private room              -40.598379
## Brooklyn:Shared room-Staten Island:Private room           -29.337120
## Manhattan:Shared room-Staten Island:Private room           -1.156444
## Queens:Shared room-Staten Island:Private room             -32.832392
## Staten Island:Shared room-Staten Island:Private room      -63.293640
## Brooklyn:Shared room-Bronx:Shared room                    -23.064007
## Manhattan:Shared room-Bronx:Shared room                     5.013734
## Queens:Shared room-Bronx:Shared room                      -25.730021
## Staten Island:Shared room-Bronx:Shared room               -51.104867
## Manhattan:Shared room-Brooklyn:Shared room                 16.306892
## Queens:Shared room-Brooklyn:Shared room                   -15.966993
## Staten Island:Shared room-Brooklyn:Shared room            -48.308668
## Queens:Shared room-Manhattan:Shared room                  -43.589847
## Staten Island:Shared room-Manhattan:Shared room           -76.140098
## Staten Island:Shared room-Queens:Shared room              -47.949473
##                                                                   upr
## Brooklyn:Entire home/apt-Bronx:Entire home/apt             45.1772604
## Manhattan:Entire home/apt-Bronx:Entire home/apt            78.6264475
## Queens:Entire home/apt-Bronx:Entire home/apt               28.8965911
## Staten Island:Entire home/apt-Bronx:Entire home/apt        24.8766709
## Bronx:Private room-Bronx:Entire home/apt                  -40.3706014
## Brooklyn:Private room-Bronx:Entire home/apt               -32.7613100
## Manhattan:Private room-Bronx:Entire home/apt               -4.9395682
## Queens:Private room-Bronx:Entire home/apt                 -36.9987490
## Staten Island:Private room-Bronx:Entire home/apt          -34.5122126
## Bronx:Shared room-Bronx:Entire home/apt                   -40.8979879
## Brooklyn:Shared room-Bronx:Entire home/apt                -51.8219519
## Manhattan:Shared room-Bronx:Entire home/apt               -24.2593294
## Queens:Shared room-Bronx:Entire home/apt                  -49.9726786
## Staten Island:Shared room-Bronx:Entire home/apt             3.0471811
## Manhattan:Entire home/apt-Brooklyn:Entire home/apt         35.9111122
## Queens:Entire home/apt-Brooklyn:Entire home/apt           -12.6558049
## Staten Island:Entire home/apt-Brooklyn:Entire home/apt    -13.7743373
## Bronx:Private room-Brooklyn:Entire home/apt               -80.6381651
## Brooklyn:Private room-Brooklyn:Entire home/apt            -75.4293136
## Manhattan:Private room-Brooklyn:Entire home/apt           -47.4858022
## Queens:Private room-Brooklyn:Entire home/apt              -79.0004540
## Staten Island:Private room-Brooklyn:Entire home/apt       -73.2866743
## Bronx:Shared room-Brooklyn:Entire home/apt                -78.5750386
## Brooklyn:Shared room-Brooklyn:Entire home/apt             -91.5247509
## Manhattan:Shared room-Brooklyn:Entire home/apt            -64.1152496
## Queens:Shared room-Brooklyn:Entire home/apt               -88.7821862
## Staten Island:Shared room-Brooklyn:Entire home/apt        -33.6340354
## Queens:Entire home/apt-Manhattan:Entire home/apt          -46.2241101
## Staten Island:Entire home/apt-Manhattan:Entire home/apt   -47.2864903
## Bronx:Private room-Manhattan:Entire home/apt             -114.1738818
## Brooklyn:Private room-Manhattan:Entire home/apt          -109.0570763
## Manhattan:Private room-Manhattan:Entire home/apt          -81.1040860
## Queens:Private room-Manhattan:Entire home/apt            -112.5868817
## Staten Island:Private room-Manhattan:Entire home/apt     -106.8002837
## Bronx:Shared room-Manhattan:Entire home/apt              -112.0768295
## Brooklyn:Shared room-Manhattan:Entire home/apt           -125.0508946
## Manhattan:Shared room-Manhattan:Entire home/apt           -97.6438073
## Queens:Shared room-Manhattan:Entire home/apt             -122.2962165
## Staten Island:Shared room-Manhattan:Entire home/apt       -67.1265320
## Staten Island:Entire home/apt-Queens:Entire home/apt        3.5138276
## Bronx:Private room-Queens:Entire home/apt                 -63.0006360
## Brooklyn:Private room-Queens:Entire home/apt              -56.8705744
## Manhattan:Private room-Queens:Entire home/apt             -28.9932268
## Queens:Private room-Queens:Entire home/apt                -60.7727164
## Staten Island:Private room-Queens:Entire home/apt         -55.9757792
## Bronx:Shared room-Queens:Entire home/apt                  -61.4517941
## Brooklyn:Shared room-Queens:Entire home/apt               -74.0240638
## Manhattan:Shared room-Queens:Entire home/apt              -46.5793470
## Queens:Shared room-Queens:Entire home/apt                 -71.4647470
## Staten Island:Shared room-Queens:Entire home/apt          -16.6621438
## Bronx:Private room-Staten Island:Entire home/apt          -45.6642840
## Brooklyn:Private room-Staten Island:Entire home/apt       -37.4810829
## Manhattan:Private room-Staten Island:Entire home/apt       -9.6741709
## Queens:Private room-Staten Island:Entire home/apt         -41.8148626
## Staten Island:Private room-Staten Island:Entire home/apt  -40.6118787
## Bronx:Shared room-Staten Island:Entire home/apt           -47.9141135
## Brooklyn:Shared room-Staten Island:Entire home/apt        -57.3678765
## Manhattan:Shared room-Staten Island:Entire home/apt       -29.7311075
## Queens:Shared room-Staten Island:Entire home/apt          -56.0479344
## Staten Island:Shared room-Staten Island:Entire home/apt    -5.0405906
## Brooklyn:Private room-Bronx:Private room                   16.6297452
## Manhattan:Private room-Bronx:Private room                  44.4664774
## Queens:Private room-Bronx:Private room                     12.4871817
## Staten Island:Private room-Bronx:Private room              15.8859821
## Bronx:Shared room-Bronx:Private room                        9.9509764
## Brooklyn:Shared room-Bronx:Private room                    -1.7583324
## Manhattan:Shared room-Bronx:Private room                   25.7541360
## Queens:Shared room-Bronx:Private room                       0.4120118
## Staten Island:Shared room-Bronx:Private room               54.3387652
## Manhattan:Private room-Brooklyn:Private room               30.3632402
## Queens:Private room-Brooklyn:Private room                  -1.1348556
## Staten Island:Private room-Brooklyn:Private room            4.6174889
## Bronx:Shared room-Brooklyn:Private room                    -0.6645644
## Brooklyn:Shared room-Brooklyn:Private room                -13.6272718
## Manhattan:Shared room-Brooklyn:Private room                13.7809436
## Queens:Shared room-Brooklyn:Private room                  -10.8782476
## Staten Island:Shared room-Brooklyn:Private room            44.2814053
## Queens:Private room-Manhattan:Private room                -28.7838851
## Staten Island:Private room-Manhattan:Private room         -23.1222629
## Bronx:Shared room-Manhattan:Private room                  -28.4193505
## Brooklyn:Shared room-Manhattan:Private room               -41.3511346
## Manhattan:Shared room-Manhattan:Private room              -13.9398679
## Queens:Shared room-Manhattan:Private room                 -38.6174648
## Staten Island:Shared room-Manhattan:Private room           16.5147746
## Staten Island:Private room-Queens:Private room              9.3980912
## Bronx:Shared room-Queens:Private room                       4.0167296
## Brooklyn:Shared room-Queens:Private room                   -8.7438311
## Manhattan:Shared room-Queens:Private room                  18.6838161
## Queens:Shared room-Queens:Private room                     -6.0941456
## Staten Island:Shared room-Queens:Private room              48.8836209
## Bronx:Shared room-Staten Island:Private room               10.5217475
## Brooklyn:Shared room-Staten Island:Private room             0.8250062
## Manhattan:Shared room-Staten Island:Private room           28.4509077
## Queens:Shared room-Staten Island:Private room               2.2266675
## Staten Island:Shared room-Staten Island:Private room       53.5974229
## Brooklyn:Shared room-Bronx:Shared room                     24.6285255
## Manhattan:Shared room-Bronx:Shared room                    52.3573617
## Queens:Shared room-Bronx:Shared room                       25.2009278
## Staten Island:Shared room-Bronx:Shared room                71.4852814
## Manhattan:Shared room-Brooklyn:Shared room                 39.4996848
## Queens:Shared room-Brooklyn:Shared room                    13.8733822
## Staten Island:Shared room-Brooklyn:Shared room             67.1245640
## Queens:Shared room-Manhattan:Shared room                  -14.3103413
## Staten Island:Shared room-Manhattan:Shared room            39.1494174
## Staten Island:Shared room-Queens:Shared room               68.8589806
##                                                              p adj
## Brooklyn:Entire home/apt-Bronx:Entire home/apt           0.0000000
## Manhattan:Entire home/apt-Bronx:Entire home/apt          0.0000000
## Queens:Entire home/apt-Bronx:Entire home/apt             0.0000000
## Staten Island:Entire home/apt-Bronx:Entire home/apt      0.8601082
## Bronx:Private room-Bronx:Entire home/apt                 0.0000000
## Brooklyn:Private room-Bronx:Entire home/apt              0.0000000
## Manhattan:Private room-Bronx:Entire home/apt             0.0000191
## Queens:Private room-Bronx:Entire home/apt                0.0000000
## Staten Island:Private room-Bronx:Entire home/apt         0.0000000
## Bronx:Shared room-Bronx:Entire home/apt                  0.0000000
## Brooklyn:Shared room-Bronx:Entire home/apt               0.0000000
## Manhattan:Shared room-Bronx:Entire home/apt              0.0000000
## Queens:Shared room-Bronx:Entire home/apt                 0.0000000
## Staten Island:Shared room-Bronx:Entire home/apt          0.0859227
## Manhattan:Entire home/apt-Brooklyn:Entire home/apt       0.0000000
## Queens:Entire home/apt-Brooklyn:Entire home/apt          0.0000000
## Staten Island:Entire home/apt-Brooklyn:Entire home/apt   0.0000000
## Bronx:Private room-Brooklyn:Entire home/apt              0.0000000
## Brooklyn:Private room-Brooklyn:Entire home/apt           0.0000000
## Manhattan:Private room-Brooklyn:Entire home/apt          0.0000000
## Queens:Private room-Brooklyn:Entire home/apt             0.0000000
## Staten Island:Private room-Brooklyn:Entire home/apt      0.0000000
## Bronx:Shared room-Brooklyn:Entire home/apt               0.0000000
## Brooklyn:Shared room-Brooklyn:Entire home/apt            0.0000000
## Manhattan:Shared room-Brooklyn:Entire home/apt           0.0000000
## Queens:Shared room-Brooklyn:Entire home/apt              0.0000000
## Staten Island:Shared room-Brooklyn:Entire home/apt       0.0000074
## Queens:Entire home/apt-Manhattan:Entire home/apt         0.0000000
## Staten Island:Entire home/apt-Manhattan:Entire home/apt  0.0000000
## Bronx:Private room-Manhattan:Entire home/apt             0.0000000
## Brooklyn:Private room-Manhattan:Entire home/apt          0.0000000
## Manhattan:Private room-Manhattan:Entire home/apt         0.0000000
## Queens:Private room-Manhattan:Entire home/apt            0.0000000
## Staten Island:Private room-Manhattan:Entire home/apt     0.0000000
## Bronx:Shared room-Manhattan:Entire home/apt              0.0000000
## Brooklyn:Shared room-Manhattan:Entire home/apt           0.0000000
## Manhattan:Shared room-Manhattan:Entire home/apt          0.0000000
## Queens:Shared room-Manhattan:Entire home/apt             0.0000000
## Staten Island:Shared room-Manhattan:Entire home/apt      0.0000000
## Staten Island:Entire home/apt-Queens:Entire home/apt     0.4222885
## Bronx:Private room-Queens:Entire home/apt                0.0000000
## Brooklyn:Private room-Queens:Entire home/apt             0.0000000
## Manhattan:Private room-Queens:Entire home/apt            0.0000000
## Queens:Private room-Queens:Entire home/apt               0.0000000
## Staten Island:Private room-Queens:Entire home/apt        0.0000000
## Bronx:Shared room-Queens:Entire home/apt                 0.0000000
## Brooklyn:Shared room-Queens:Entire home/apt              0.0000000
## Manhattan:Shared room-Queens:Entire home/apt             0.0000000
## Queens:Shared room-Queens:Entire home/apt                0.0000000
## Staten Island:Shared room-Queens:Entire home/apt         0.0011408
## Bronx:Private room-Staten Island:Entire home/apt         0.0000000
## Brooklyn:Private room-Staten Island:Entire home/apt      0.0000000
## Manhattan:Private room-Staten Island:Entire home/apt     0.0000005
## Queens:Private room-Staten Island:Entire home/apt        0.0000000
## Staten Island:Private room-Staten Island:Entire home/apt 0.0000000
## Bronx:Shared room-Staten Island:Entire home/apt          0.0000000
## Brooklyn:Shared room-Staten Island:Entire home/apt       0.0000000
## Manhattan:Shared room-Staten Island:Entire home/apt      0.0000000
## Queens:Shared room-Staten Island:Entire home/apt         0.0000000
## Staten Island:Shared room-Staten Island:Entire home/apt  0.0187011
## Brooklyn:Private room-Bronx:Private room                 0.0002207
## Manhattan:Private room-Bronx:Private room                0.0000000
## Queens:Private room-Bronx:Private room                   0.5375413
## Staten Island:Private room-Bronx:Private room            1.0000000
## Bronx:Shared room-Bronx:Private room                     0.8315876
## Brooklyn:Shared room-Bronx:Private room                  0.0070489
## Manhattan:Shared room-Bronx:Private room                 0.0000586
## Queens:Shared room-Bronx:Private room                    0.0680234
## Staten Island:Shared room-Bronx:Private room             1.0000000
## Manhattan:Private room-Brooklyn:Private room             0.0000000
## Queens:Private room-Brooklyn:Private room                0.0006083
## Staten Island:Private room-Brooklyn:Private room         0.7013308
## Bronx:Shared room-Brooklyn:Private room                  0.0360862
## Brooklyn:Shared room-Brooklyn:Private room               0.0000000
## Manhattan:Shared room-Brooklyn:Private room              0.5442640
## Queens:Shared room-Brooklyn:Private room                 0.0000000
## Staten Island:Shared room-Brooklyn:Private room          0.9999865
## Queens:Private room-Manhattan:Private room               0.0000000
## Staten Island:Private room-Manhattan:Private room        0.0000000
## Bronx:Shared room-Manhattan:Private room                 0.0000000
## Brooklyn:Shared room-Manhattan:Private room              0.0000000
## Manhattan:Shared room-Manhattan:Private room             0.0000000
## Queens:Shared room-Manhattan:Private room                0.0000000
## Staten Island:Shared room-Manhattan:Private room         0.5064717
## Staten Island:Private room-Queens:Private room           0.9998842
## Bronx:Shared room-Queens:Private room                    0.2543544
## Brooklyn:Shared room-Queens:Private room                 0.0000000
## Manhattan:Shared room-Queens:Private room                0.0040161
## Queens:Shared room-Queens:Private room                   0.0000511
## Staten Island:Shared room-Queens:Private room            1.0000000
## Bronx:Shared room-Staten Island:Private room             0.8016690
## Brooklyn:Shared room-Staten Island:Private room          0.0876074
## Manhattan:Shared room-Staten Island:Private room         0.1095788
## Queens:Shared room-Staten Island:Private room            0.1692098
## Staten Island:Shared room-Staten Island:Private room     1.0000000
## Brooklyn:Shared room-Bronx:Shared room                   1.0000000
## Manhattan:Shared room-Bronx:Shared room                  0.0036142
## Queens:Shared room-Bronx:Shared room                     1.0000000
## Staten Island:Shared room-Bronx:Shared room              0.9999997
## Manhattan:Shared room-Brooklyn:Shared room               0.0000000
## Queens:Shared room-Brooklyn:Shared room                  1.0000000
## Staten Island:Shared room-Brooklyn:Shared room           0.9999998
## Queens:Shared room-Manhattan:Shared room                 0.0000000
## Staten Island:Shared room-Manhattan:Shared room          0.9990739
## Staten Island:Shared room-Queens:Shared room             0.9999993

A two-way ANOVA was carried out on Airbnb home prices by neighbourhood groups and room types. Since the interaction effect was statistically significant, Tukey’s HSD post hoc tests were carried out. As can be seen above, most of the interactions were statistically significant (p < 0.05), but not all of them. For instance, the mean price of a private room was significantly different depending on whether it is in Manhattan or Brooklyn, but there is noevidence to suggest that the mean price of a shared room in Manhattan was significantly different from the mean price of a private room in Brooklyn (p = 0.9575967).

Chapter 6: Neighborhood Groups, Room Types and Availability

6.1 Neighborhood Groups and Availability

Smart Question: What is the least available neighborhood group?

Here, we are trying to anwer the question “What is the least available neighborhood group? and how can we rank their availabilities?”. If we rank the Neighborhood groups based on availability, the most popular Neighborhood Group is Brooklyn, followed by Manhattan, Queens, Bronx and Staten Island respectively.

##         Bronx      Brooklyn     Manhattan        Queens Staten Island 
##          1091         20104         21661          5666           373

If we rank the Neighborhood groups based on availability, the least available Neighborhood Group is Brooklyn, followed by Manhattan, Queens, Bronx and Staten Island respectively.

Brooklyn
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     0.0     0.0    28.0   100.2   188.0   365.0

Lets look at the least availabile neighborhood group, Brooklyn. The median for Brooklyn is 28 days, meaning half of the neighborhoods in Brooklyn’s availability is less than 28 days of the 365days. In short, it is available 7.6712329 % of the time.

Manhattan
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##       0       0      36     112     230     365

Lets look at the second least availabile neighborhood group, Manhattan The median for Manhattan is 36 days, meaning half of the neighborhoods in Manhattan’s availability is less than 36 days of the 365days. In short, it is available 9.8630137 % of the time.

Queens
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     0.0     2.0    98.0   144.5   286.0   365.0

Lets look at the third least availabile neighborhood group, Queens The median for Queens is 98 days, meaning half of the neighborhoods in Queens’s availability is less than 98 days of the 365days. In short, it is available 26.8493151 % of the time.

Bronx
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     0.0    37.0   148.0   165.8   313.5   365.0

Lets look at the fourth least availabile neighborhood group, Bronx The median for Bronx is 148 days, meaning half of the neighborhoods in Bronx’s availability is less than 148 days of the 365days. In short, it is available 40.5479452 % of the time.

Staten Island
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     0.0    78.0   219.0   199.7   333.0   365.0

Lets look at the most availabile neighborhood group, Staten Island The median for Staten Island is 219 days, meaning half of the neighborhoods in Staten Island’s availability is less than 219 days of the 365days. In short, it is available 60 % of the time.

6.1.1 ANOVA and Tukey for Neighborhood Group and Availability

Smart Question: Are the differences between availabilities significant?

Based on the information in their availabilities, are the difference significant enough accross the neighborhood groups?

##                        Df    Sum Sq Mean Sq F value Pr(>F)    
## neighbourhood_group     4  14741568 3685392   216.5 <2e-16 ***
## Residuals           48890 832318962   17024                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = availability_365 ~ neighbourhood_group, data = Airbnbdata)
## 
## $neighbourhood_group
##                              diff        lwr        upr     p adj
## Brooklyn-Bronx          -65.52664 -76.590498 -54.462791 0.0000000
## Manhattan-Bronx         -53.77953 -64.822893 -42.736160 0.0000000
## Queens-Bronx            -21.30712 -33.074224  -9.540014 0.0000078
## Staten Island-Bronx      33.91935  12.571845  55.266850 0.0001425
## Manhattan-Brooklyn       11.74712   8.261586  15.232650 0.0000000
## Queens-Brooklyn          44.21953  38.866233  49.572819 0.0000000
## Staten Island-Brooklyn   99.44599  80.847367 118.044617 0.0000000
## Queens-Manhattan         32.47241  27.161586  37.783230 0.0000000
## Staten Island-Manhattan  87.69887  69.112429 106.285319 0.0000000
## Staten Island-Queens     55.22647  36.201095  74.251837 0.0000000

We can see the variation of the means and medians of availabilities of each neighborhood group and we perforemed ANNOVA testing to see if there is a true difference between these values. We found out that the p-value is less than 0.05 and there fore we reject the null hypothesis. This means there is a significant difference between the neighborhood groups in terms of their availability.

We also performend a tukey test, and we can see that the p-values are less than 0.5 which means their variations are significant.

6.2 Room Types and Availability

Smart Question: What is the most available type of room?

## Entire home/apt    Private room     Shared room 
##           25409           22326            1160

We see the number of data collected for each room type. Based on room type, the most available is a shared room. Private rooms and Entire Homes/Apartments are almost equally available. We will also determine if the difference in means is significant.

Entire Home Availability
##  availability_365
##  Min.   :  0.0   
##  1st Qu.:  0.0   
##  Median : 42.0   
##  Mean   :111.9   
##  3rd Qu.:229.0   
##  Max.   :365.0
Private Room Availability
##  availability_365
##  Min.   :  0.0   
##  1st Qu.:  0.0   
##  Median : 45.0   
##  Mean   :111.2   
##  3rd Qu.:214.0   
##  Max.   :365.0
Shared Home Availability
##  availability_365
##  Min.   :  0     
##  1st Qu.:  0     
##  Median : 90     
##  Mean   :162     
##  3rd Qu.:341     
##  Max.   :365

6.2.1 ANNOVA and Tukey for Room Type and Availability

Smart Question: Are the differences between availabilities significant?

##                Df    Sum Sq Mean Sq F value Pr(>F)    
## room_type       2   2884561 1442280   83.53 <2e-16 ***
## Residuals   48892 844175969   17266                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = availability_365 ~ room_type, data = Airbnbdata)
## 
## $room_type
##                                    diff       lwr       upr     p adj
## Private room-Entire home/apt -0.7163712 -3.541374  2.108632 0.8231684
## Shared room-Entire home/apt  50.0805582 40.834331 59.326785 0.0000000
## Shared room-Private room     50.7969294 41.522872 60.070987 0.0000000

We can see the variation of the means and medians of availabilities of each room type and we perforemed ANNOVA testing to see if there is a true difference between these values. We found out that the p-value is less than 0.05 and there fore we reject the null hypothesis. This means there is a significant difference between the room types in terms of their availability.

We also performend a tukey test, and we can see that the p-value for private room and entire home is more than 0.5. Their variations are insignificant and there is no true difference between their means.

References Airbnb. (n.d.). What do the different home types mean? Retrieved from https://www.airbnb.com/help/article/317/what-do-the-different-home-types-mean Bivens, J. (2019). The economic costs and benefits of Airbnb. Retrieved from https://www.epi.org/publication/the-economic-costs-and-benefits-of-airbnb-no-reason-for-local-policymakers-to-let-airbnb-bypass-tax-or-regulatory-obligations/ Nath, T. (2019). Airbnb vs. Hotels: What’s the Difference? Retrieved from https://www.investopedia.com/articles/investing/112414/airbnb-brings-sharing-economy-hotels.asp Worldatlas. (n.d.). The Boroughs Of New York City – NYC Boroughs Map: Information about the five NYC boroughs: Staten Island, Manhattan, the Bronx, and Brooklyn. Retrieved from https://www.worldatlas.com/articles/the-boroughs-of-new-york-city.html